<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <h3 class="panel-title">供应商详情 - {$row.name}</h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-6">
                <table class="table table-bordered">
                    <tr>
                        <th width="120">供应商名称</th>
                        <td>{$row.name}</td>
                    </tr>
                    <tr>
                        <th>供应商编码</th>
                        <td>{$row.code}</td>
                    </tr>
                    <tr>
                        <th>联系人</th>
                        <td>{$row.contact_person}</td>
                    </tr>
                    <tr>
                        <th>联系电话</th>
                        <td>{$row.phone}</td>
                    </tr>
                    <tr>
                        <th>手机号码</th>
                        <td>{$row.mobile}</td>
                    </tr>
                    <tr>
                        <th>邮箱</th>
                        <td>{$row.email}</td>
                    </tr>
                    <tr>
                        <th>地址</th>
                        <td>{$row.address}</td>
                    </tr>
                </table>
            </div>
            <div class="col-md-6">
                <table class="table table-bordered">
                    <tr>
                        <th width="120">供应商类别</th>
                        <td>{$row.category}</td>
                    </tr>
                    <tr>
                        <th>供应商等级</th>
                        <td>{$row.level_text}</td>
                    </tr>
                    <tr>
                        <th>付款条件</th>
                        <td>{$row.payment_terms}</td>
                    </tr>
                    <tr>
                        <th>授信额度</th>
                        <td>¥{$row.credit_amount}</td>
                    </tr>
                    <tr>
                        <th>开户银行</th>
                        <td>{$row.bank_name}</td>
                    </tr>
                    <tr>
                        <th>银行账号</th>
                        <td>{$row.bank_account}</td>
                    </tr>
                    <tr>
                        <th>税号</th>
                        <td>{$row.tax_number}</td>
                    </tr>
                </table>
            </div>
        </div>
        
        {if condition="$row.remark"}
        <div class="row">
            <div class="col-md-12">
                <h4>备注信息</h4>
                <p class="text-muted">{$row.remark}</p>
            </div>
        </div>
        {/if}
        
        <div class="row">
            <div class="col-md-12">
                <h4>统计信息</h4>
                <div class="row">
                    <div class="col-md-3">
                        <div class="info-box">
                            <span class="info-box-icon bg-blue"><i class="fa fa-cubes"></i></span>
                            <div class="info-box-content">
                                <span class="info-box-text">供应物料</span>
                                <span class="info-box-number">{$materialCount}种</span>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="info-box">
                            <span class="info-box-icon bg-green"><i class="fa fa-shopping-cart"></i></span>
                            <div class="info-box-content">
                                <span class="info-box-text">采购次数</span>
                                <span class="info-box-number">{$purchaseCount}次</span>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="info-box">
                            <span class="info-box-icon bg-yellow"><i class="fa fa-money"></i></span>
                            <div class="info-box-content">
                                <span class="info-box-text">采购总额</span>
                                <span class="info-box-number">¥{$totalPurchaseAmount}</span>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="info-box">
                            <span class="info-box-icon bg-red"><i class="fa fa-star"></i></span>
                            <div class="info-box-content">
                                <span class="info-box-text">供应商等级</span>
                                <span class="info-box-number">{$row.level}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="row">
            <div class="col-md-6">
                <h4>供应的物料清单</h4>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>物料名称</th>
                            <th>报价</th>
                            <th>起订量</th>
                            <th>交货期</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach name="materials" item="vo"}
                        <tr>
                            <td>{$vo.material.name}</td>
                            <td>¥{$vo.price}</td>
                            <td>{$vo.min_order_qty}</td>
                            <td>{$vo.delivery_days}天</td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
            <div class="col-md-6">
                <h4>最近采购记录</h4>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>采购单号</th>
                            <th>物料</th>
                            <th>数量</th>
                            <th>金额</th>
                            <th>日期</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach name="purchases" item="vo"}
                        <tr>
                            <td>{$vo.purchase_no}</td>
                            <td>{$vo.material.name}</td>
                            <td>{$vo.quantity}</td>
                            <td>¥{$vo.total_amount}</td>
                            <td>{$vo.purchase_date|date='Y-m-d'}</td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
